"""
    1、函数可以作为参数进行传递
    2、函数可以作为返回值进行返回
    3、函数名称可以当成变量一样进行赋值操作
"""

# def func():
#     print("hello")
#
# def fff(fn): #fn要求是个函数
#     fn()     #func()
#
# fff(func)

def game(game):
    def inner():
        print("打游戏开外挂")
        game()
        print("关闭外挂")
    return inner

def guanjia(game):
    def inner(*args, **kwargs):
        print("打开外挂")
        game(*args, **kwargs)
        print("关闭外挂")
    return inner

@guanjia
def play_dnf(username,password):
    print("我要开始玩dnf了",username,password)
    print("你好啊，我是XXXX，today is a nice day")

@guanjia
def play_lol(username,password,hero):
    print("我要开始玩lol了",username,password,hero)
    print("德玛西亚！！！")

play_dnf("player1", "123456")
play_lol("player2", "654321", "盖伦")